<?php
/**
*
* @package MoltX phpBB Utilities
* @author $Author: moltendorf $
* @version $Id: hook_molten.php 193 2009-10-16 05:25:53Z moltendorf $
* @latest $URL: http://molten-chat.googlecode.com/svn/trunk/source/includes/hooks/hook_molten.php $
* @copyright (c) 2005-2009 Matthew Oltendorf
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* phpBB hook
* @package MoltX Live Post
*/
class molten
{
	/* --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- //
	// Name: __construct
	// Title: Class construction.
	// Variables: None.
	// Description: Disabled.
	// --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- */
	private function __construct ()
	{
		// No further actions required.
		return false;
	}

	/* --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- //
	// Name: __destruct
	// Title: Class destruction.
	// Variables: None.
	// Description: Disabled.
	// --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- */
	private function __destruct ()
	{
		// No further actions required.
		return false;
	}

	/* --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- //
	// Name: get_page
	// Title: Get page.
	// Variables: None.
	// Description: Get the current page.
	// --|-- ----- ----- ----- -----|----- ----- ----- ----- --|-- */
	public static function get_page()
	{
		static $on_page = null;

		// Only do stuff if it's null.
		if (!$on_page)
		{
			global $user;

			// Grab current page.
			$on_page = array();
			preg_match('#^([a-z/_]+)#i', $user->page['page_name'], $on_page);
			$on_page = sizeof($on_page) ? $on_page[1] : 'index';
		}

		// Send it back.
		return $on_page;
	}
}
?>
